package dev.bong.vo;

import dev.bong.pojo.entity.User;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author: bong~
 * @description: TODO
 * @date: 2024/4/11 20:54
 * @version: 1.0
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("教师信息")
public class TeacherVo {

    private String userAccount;
    private String userPassword;
    private String userName;
    private String professionalTitle;


    public static User toUser(TeacherVo vo){

        User user=new User();
        user.setUserAccount(vo.getUserAccount());
        user.setUserPassword(vo.getUserPassword());
        user.setUserName(vo.getUserName());
        user.setProfessionalTitle(user.getProfessionalTitle());

        return user;
    }

    public static  TeacherVo toTeacherVo(User user){

        TeacherVo teacherVo=new TeacherVo();
        teacherVo.setUserAccount(user.getUserAccount());
        teacherVo.setUserPassword(user.getUserPassword());
        teacherVo.setUserName(user.getUserName());
        teacherVo.setProfessionalTitle(user.getProfessionalTitle());

        return teacherVo;
    }

}
